class Solution(object):
    def minProductSum(self, nums1, nums2):
        nums1.sort()
        nums2.sort(reverse=True)
        n = len(nums1)
        return sum([nums1[i] * nums2[i] for i in range(n)])